package com.googlecode.struts2tagsplugin.views.jsp.ui;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;

import com.googlecode.struts2tagsplugin.components.TooglePanel;
import com.opensymphony.xwork2.util.ValueStack;

public class TooglePanelTag extends AbstractUITag {
    protected String name;
    protected String open;

    @Override
    public Component getBean(ValueStack stack, HttpServletRequest req,
        HttpServletResponse res) {
        return new TooglePanel(stack, req, res);
    }

    @Override
    protected void populateParams() {
        super.populateParams();

        TooglePanel tooglePanel = (TooglePanel) this.component;
        tooglePanel.setName(this.name);
        tooglePanel.setOpen(this.open);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setOpen(String open) {
        this.open = open;
    }
}
